//
//  PersianCat.m
//  构造方法
//
//  Created by Vine on 2017/4/23.
//  Copyright © 2017年 Vine. All rights reserved.
//

#import "PersianCat.h"

@implementation PersianCat

- (PersianCat *)init{
    self = [super init];//self 就是谁调用这个方法，谁就是self
    if (self) {//防止开辟空间失败
        _age = 0;
        _sex = '\0';
        strcpy(_color, "");
    }
    return self;
}
- (PersianCat *)initWithAge:(int)age andSex:(char)sex andColor:(char *)color{
    self = [super init];
    if (self) {
        _age = age;
        _sex = sex;
        strcpy(_color, color);
    }
    return self;
}
- (void)setAge:(int)age andSex:(char)sex andColor:(char *)color {
    _age = age;
    _sex = sex;
    strcpy(_color, color);//c字符串复制
}

- (void)jump {
    NSLog(@"Jump!");
}

- (void)printInformation {
    NSLog(@"Age : %d, sex : %c, color : %s",_age, _sex, _color);
}
@end
